<!--
 * @Author: wpp 906008377@qq.com
 * @Date: 2024-08-21 10:00:44
 * @LastEditors: wpp 906008377@qq.com
 * @LastEditTime: 2025-03-28 14:54:25
 * @FilePath: \vue-project\src\App.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->

<template>
  <el-config-provider :locale="locale">
    <RouterView />
  </el-config-provider>
</template>

<script setup lang="ts">
import { RouterView } from 'vue-router'
import useGetRoute from './hooks/useLogRoute'

import zhCn from 'element-plus/es/locale/lang/zh-cn'
import en from 'element-plus/es/locale/lang/en'
import { useGlobyStory } from './stores/useGlobyStory'

let locale = ref()

const { language } = toRefs(useGlobyStory())
watch(
  language,
  (newVal) => {
    locale.value = newVal === 'zhCn' ? zhCn : en
  },
  {
    immediate: true
  }
)

useGetRoute('App')
</script>

<style lang="scss"></style>
